package com.ai.zuochengyun.phase01.class03;

/**
 * 递归遍历
 */
public class Code12_RecursiveTraversalBT {
    public static void main(String[] args) {
        
    }

    public static void pre(BinaryTreeNode head) {
        if (head == null) {
            return;
        }

        System.out.println(head.value);
        pre(head.left);
        pre(head.right);
    }

    public static void in(BinaryTreeNode head) {
        if (head == null) {
            return;
        }

        in(head.left);
        System.out.println(head.value);
        in(head.right);
    }

    public static void pos(BinaryTreeNode head) {
        if (head == null) {
            return;
        }

        pos(head.left);
        pos(head.right);
        System.out.println(head.value);
    }
}
